Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: optimize experience of hover value #220

Merged
merged 2 commits into from
Feb 25, 2021
Merged

Conversation

kerm1it
Copy link
Member

@kerm1it kerm1it commented Feb 22, 2021

close ant-design/ant-design#29412

在 basic 那个例子的 Uncontrolled DateTime 查看效果

@vercel
Copy link

vercel bot commented Feb 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/picker/CbvWiYKpj3r6UwShrbxURARYGBiN
✅ Preview: https://picker-git-opmize-hover-value-react-component.vercel.app

@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #220 (29216be) into master (6af42f8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #220   +/-   ##
=======================================
  Coverage   99.52%   99.52%           
=======================================
  Files          45       45           
  Lines        2104     2113    +9     
  Branches      619      623    +4     
=======================================
+ Hits         2094     2103    +9     
  Misses          8        8           
  Partials        2        2           
Impacted Files Coverage Δ
src/panels/DatetimePanel/index.tsx 100.00% <ø> (ø)
src/PickerPanel.tsx 100.00% <100.00%> (ø)
src/utils/timeUtil.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6af42f8...29216be. Read the comment docs.

@kerm1it kerm1it requested a review from afc163 February 22, 2021 14:28
@kerm1it
Copy link
Member Author

kerm1it commented Feb 22, 2021

先别合,有点问题

@kerm1it
Copy link
Member Author

kerm1it commented Feb 25, 2021

优化了 viewDate 中 postDate 的逻辑。

之前:

当前的 viewDate 为空时返回当前时间,因此当未选择时,切换 date 会看到 placeholder 是动态的,一旦 viewDate 固定了,就会返回固定的 viewDate(切换月份、年份面板导致)

之后:

viewDate 为空时逻辑保持不变,当不为空时加了一层判断:如果当前 value 为空且设置了 showTime 选项时,viewDate 中的 time 按照 showTime.defaultValue > defaultValue > now 优先级顺序设置为对应的 time。

@afc163 @zombieJ 看看有没有问题?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When the 'showTime' property of DatePicker is 'true', hover date options, placeholder is wrong
2 participants